package com.example.springboot.config.mainifest;

import java.lang.instrument.Instrumentation;
import java.lang.instrument.UnmodifiableClassException;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/11/10 12:04
 */
public class BeforeJvmAgent  {
    public static void premain(String agentArgs, Instrumentation inst) throws ClassNotFoundException, UnmodifiableClassException {
        System.out.println("premain invoke!");

        inst.addTransformer(new MyClassFileTransformer());

    }

    public static void main(String[] args) {
        System.out.println("main invoke!");
    }
}
